Digital image recompression

ABSTRACT

Techniques for image recompression. In one implementation, the techniques are implemented to recompress a baseline joint photographic experts group (JPEG) image with compression savings. The techniques replace the Huffman coding of baseline JPEG with an arithmetic coding that uses a sophisticated adaptive probability model. The arithmetic coding techniques avoid global operations such as global sorting that would prevent distributed and multithreaded decompression operations when recovering the original JPEG image from the recompressed image. At the same time, the techniques realize substantial compression savings relative to baseline JPEG, on average 23% compressing savings in some implementations.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the benefit as a continuation of U.S. patentapplication Ser. No. 15/614,860, filed Jun. 6, 2017; which is acontinuation of Ser. No. 15/281,604, filed Sep. 30, 2016, which claimspriority to U.S. provisional application No. 62/395,269, filed Sep. 15,2016, the entire contents of each of which is hereby incorporated byreference as if fully set forth herein. The Applicant hereby rescindsany disclaimer of claim scope in the parent applications or theprosecution history thereof and advise the USPTO that the claims in thisapplication may be broader than any claim in the parent applications.

TECHNICAL FIELD

The disclosed implementations relate generally to image compression. Thedisclosed implementations relate more specifically to techniques forimage recompression.

BACKGROUND

In the last decade, centrally hosted network filesystems withdisconnected operation have grown to serve hundreds of millions ofusers. These services include SugarSync®, Dropbox®, Box®, Google Drive®,Microsoft OneDrive®, and Amazon Cloud Drive®.

Commercially, these systems typically offer users a maximum storagequota in exchange for a flat monthly fee, or no fee at all. Meanwhile,the cost to operate such a system increases with the amount of user datastored. Therefore, operators benefit from techniques that reduce the netamount of user data stored.

These filesystems can rapidly become gargantuan. For example, one of theabove-mentioned services currently stores roughly one Exabyte of userdata of which roughly 40% is made of baseline compressed JPEG images.

Baseline Joint Photographic Experts Group (JPEG) image compressionencompasses a lossy encoding process based on a discrete cosinetransform (DCT). In the encoding process, source image data is groupedinto 8 by 8 blocks of samples. Each sample block is transformed by aforward DCT into a set of 64 values referred to as DCT coefficients. Ofthe 64 values, one of the values is referred to as the DC coefficientand the other 63 values as the AC coefficients. Each of the 64coefficients are quantized using one of 64 corresponding values from aquantization table.

After quantization, the quantized DC coefficient and the 63 quantized ACcoefficients are entropy encoded. In doing so, the previous quantized DCcoefficient is used to predict the current quantized DC coefficient, andthe difference is encoded. The 63 quantized AC coefficients areconverted into a zig zag sequence. The quantized DCT coefficients arethen passed to a Huffman encoding procedure which compresses the datafurther.

For decoding the compressed JPEG image data, essentially the inverse ofthe encoding steps is performed. The entropy decoder decodes the zig zagsequence of quantized DCT coefficients. After dequantization, the DCTcoefficients are transformed to an 8×8 block of samples by an inverseDCT (IDCT).

Large-scale centrally hosted network filesystems such as those mentionedabove would appreciate techniques providing greater compressionefficiency relative to baseline JPEG. Such techniques could be employedto reduce the total size of the user data corpus stored and therebyreduce operating costs.

Methods exist for improved image compression relative to baseline JPEG.In one approach named “packJPG,” segmented entropy encoding is employedabout the End-of-Block (EOB) of the 8 by 8 DCT transformed block. TheEOB is defined as the position after the last non-zero coefficient inthe zig-zag order of the 64 coefficients. The packJPG approachpurportedly can reduce baseline JPEG image file sizes by an average of15%. More information on packJPG is available in the paper by Stirner M.and Seelmann G., “Improved Redundancy Reduction for JPEG Files,” PictureCoding Symposium by ERASIP, November 2007.

While the packJPG approach can recompress a baseline JPEG file with areduced file size, the packJPG approach requires re-arranging compressedpixel values in a globally sorted order. Thus, decompressing a packJPGcompressed image to the original baseline JPEG image may besingle-threaded, may require access to the entire packJPG compressedimage, and may require decoding the packJPG compressed image into memorybefore a first byte of the original baseline JPEG compressed image canbe output. Overall, the time-to-first byte and the time-to-last byte forthe decompression operation may be too high to meet the service goals oflarge-scale centrally hosted network filesystems such as those mentionedabove.

What is needed, then, are image recompression techniques that can beimplemented without global operations so that the decompressionoperation to recover the original compressed image from the recompressedimage can be distributed across independent portions of the recompressedimage and, within each portion, multithreaded and with low time-to-firstbyte.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 depicts an image recompression system per some implementations ofthe present invention.

FIG. 2 schematically depicts a statistical bin of an adaptively trainedprobability model used in an arithmetic coding procedure per someimplementations of the present invention.

FIG. 3 is a flowchart of the high-level operations involved in anadaptively trained arithmetic coding procedure per some implementationsof the present invention.

FIG. 4 schematically depicts an image component comprising sample blocksper some implementations of the present invention.

FIG. 5 depicts four general categories of quantized coefficients in aquantized coefficient block per some implementations of the presentinvention.

FIG. 6 depicts a binarization format for non-binary symbols of acategorized quantized coefficient block per some implementations of thepresent invention.

FIG. 7 depicts a binarization order of quantized coefficients in a blockof quantized coefficients per some implementations of the presentinvention.

FIG. 8 depicts an example binarization procedure in a 7 by 7 sub-blockof quantized AC coefficients per some implementations of the presentinvention.

FIG. 9 depicts a binarization format for a quantized AC Coefficient or aDC error term per some implementations of the present invention.

FIG. 10 depicts the samples involved in a local brightness predictionmethodology per some implementations of the present invention.

FIG. 11 is a flowchart of the local brightness prediction methodologyper some implementations of the present invention.

FIG. 12A depicts the samples involved in a local gradient predictionmethodology per some implementations of the present invention.

FIG. 12B depicts samples involved in a horizontal edge gradient per someimplementations of the present invention.

FIG. 12C depicts samples involved in a vertical edge gradient per someimplementations of the present invention.

FIG. 13 is a flowchart of the local gradient prediction methodology persome implementations of the present invention.

FIG. 14, it is a block diagram that illustrates a basic computing devicein which the implementations of the present invention may be embodied.

FIG. 15 is a block diagram of a basic software system that may beemployed for controlling the operation of the computing device.

DETAILED DESCRIPTION

Reference will now be made in detail to implementations, examples ofwhich are illustrated in the accompanying drawings. In the followingdetailed description, numerous specific details are set forth in orderto provide a thorough understanding of the various describedimplementations. However, it will be apparent to one of ordinary skillin the art that the various described implementations may be practicedwithout these specific details. In other instances, well-known methods,procedures, components, circuits, and networks have not been describedin detail so as not to unnecessarily obscure aspects of theimplementations.

Throughout the specification and claims, the following terms take themeanings explicitly associated herein, unless the context clearlydictates otherwise. The phrase “in some implementations,” as usedherein, do not necessarily refer to the same implementation(s), thoughit may. Thus, various implementations may be readily combined, withoutdeparting from the scope or spirit of the invention.

In addition, as used herein, the term “or” is an inclusive “or”operator, unless the context clearly dictates otherwise. The term “basedon” is not exclusive and allows for being based on additional factorsnot described, unless the context clearly dictates otherwise. Inaddition, throughout the specification, the meaning of “a,” “an,” and“the” include plural references. The meaning of “in” includes “in” and“on.”

Glossary

The following definitions are provided for purposes of illustration, notlimitation, to assist with understanding the discussion that follows.

Component: A component may be defined as one of the two-dimensionalarrays of an image.

Compressed Image (Compressed Image Data): A compressed image (orcompressed image data) is a coded representation of an image.

Dequantization: Dequantization is the inverse procedure to quantizationby which a representation of the frequency-space coefficients isrecovered.

Image (Image Data): An image (or image data) may be defined as a set oftwo-dimensional arrays of numerical data, one two-dimensional array foreach component of the image and where the component(s) of the image havemore than one bit per sample (sometimes referred to as a continuous-toneimage). An image can be a color image or a greyscale image. A colorimage has multiple components. A greyscale image has only one component.

Joint Photographic Experts Group (JPEG): JPEG is the name of a committeethat creates specifications for digital compression and coding ofcontinuous-tone still images.

Quantization: Quantization is a procedure by which frequency-spacecoefficients are linearly scaled to achieve compression.

Quantization Table: A quantization table is a set of 64 quantizationvalues used to quantize and dequantize frequency-space coefficients.

Quantization Value: An integer value used in quantization.

Sample: A sample refers to one element in the two-dimensional array of acomponent.

Overview

Format-aware and file preserving techniques for lossless recompressionof a previously compressed image providing greater compression savingsare disclosed. For example, the recompression techniques may be appliedto a baseline JPEG image to achieve on average an 23% compressionsavings. The techniques avoid global operations during recompressionthat would defeat distributed and multithreaded decompression operationswhen recovering the original compressed image from the recompressedimage. For example, the techniques do not require arranging all thecompressed pixel values in a globally sorted order that would defeatdistributed and multithreaded decoding of the recompressed image. At thesame time, the techniques can achieve compression savings whilefacilitating distributed and multithreaded decompression.

To achieve additional compression savings while avoiding globaloperations such as global sorting, the techniques, per someimplementations of the present invention, involve replacing the Huffmancoding scheme of baseline JPEG with an arithmetic coding scheme. Thearithmetic coding scheme uses an adaptive probability model to produceaccurate predictions for DCT coefficients in the original image based onthe context available earlier in the original image. Specifically, theprobability model uses an array of statistical bins. Each statisticalbin tracks the probability of a “one” vs a “zero” bit given a priorcontext in the image.

To avoid global operations such as sorting that defeat distributed andmultithreaded decompression, the probability model is expanded to covercorrelations across long distances in the image without needing to sortthe image data. Per some implementations of the present invention, theprobability model encompasses 721,564 statistical bins (i.e.,probability contexts).

Image Recompression System

FIG. 1 schematically depicts an image recompression system 102 per someimplementations of the present invention. The system 102 encompasses anentropy decoder 106, coefficient pre-processor 108, and an adaptivelytrained arithmetic coder 110. In operation, original compressed imagedata 104 produced by an original image encoder (not shown) may be inputto entropy decoder 106 to obtain an array of quantized frequency-spacecoefficients, grouped into sets or “blocks” of 64 quantized coefficients(β₁(α_(1:1), α_(1:2), α_(1:3) . . . α_(1:64)) . . . β_(n)(α_(n:1),α_(n:2), α_(n:3) . . . α_(n:64))). The array of quantizedfrequency-space coefficients may be an array of quantized DiscreteCosine Transform (DCT) coefficients, for example.

The original compressed image 104 may encompass two sections, a “header”section and a “scan” section. The scan section may encode the array ofquantized coefficients. Each block of 64 quantized coefficients may sumtogether with a series a frequency-space orthogonal patterns to describean 8 by 8 sample block of one component (e.g., luma or chroma) of animage. The quantized coefficients may be these frequency-spacecoefficients divided by quantization values present in a quantizationtable.

The header of the original compressed image 104 may contain variousimage-related information including image metadata such as image width,image height, number of components, custom tags, etc.), quantizationtable(s), and Huffman table(s). A quantization table may record thequantization values applied to the frequency-space coefficients duringquantization by the original image encoder. A Huffman table may recordvariable length codes that were used during entropy encoding by theoriginal image encoder to encode, in a lossless manner, the array ofquantized coefficients that comprise the scan section of the originalcompressed image data 104.

The original compressed image 104 may be a baseline JPEG image incompliance with ISO/IEC 10918-1, its progeny, or the equivalent.However, implementations of the present invention are not limited tobaseline JPEG. The image recompression techniques disclosed herein maybe applied to other image formats having an array of quantizedcoefficients, grouped into blocks of 64 quantized coefficients.

The image recompression system 102 may produce a further compressedimage 112 from an original compressed image 104 that further compressesthe original image. In some implementations of the present invention,where original compressed image 104 is a baseline JPEG image,recompression techniques disclosed herein may be implemented to achieveon average approximately 23% additional compression relative to baselineJPEG.

Per some implementations of the present invention, the header of theoriginal compressed image 104 is compressed by the system 102 using aknown lossless data compression algorithm such as one that uses acombination LZ1 or LZ2 and Huffman coding. The compressed header isincluded in the further compressed image 112. However, instead ofencoding the quantized coefficients from the original compressed image104 using Huffman tables, the image recompression system 102 encodes thequantized coefficients in the further compressed image 112 using anarithmetic coder 110 with probabilities driven by an adaptive trainedprobability model. Specifically, the probability model is adaptivelytrained by context information gathered from previous sections of theimage.

The entropy decoder 106 may undo the entropy encoding (e.g., Huffmancoding) applied by the original image encoder and produce the array ofquantized coefficients. As mentioned, the system 102 may apply adifferent entropy encoding scheme to the quantized coefficients afterpre-processing them as described in greater detail hereafter. Thedifferent entropy encoding scheme may encompass an adaptively trainedbinary arithmetic coding procedure that is supplied with carefullychosen context information from previous sections of the image. Morespecifically, the arithmetic coding procedure may encompass a customprobability model that is adaptively trained by context informationgathered from previous sections of the image. The arithmetic codingprocedure and probability model are also described in greater detailhereafter.

As described in greater detail hereinafter, the coefficientpre-processor 108 may pre-process the array of quantized coefficientsand emit symbols for entropy encoding by the arithmetic coder 110. Thepre-processing performed by the coefficient pre-processor 108 maygenerally involve binarizing the array of quantized coefficient as asequence of binary symbols which are then input to the arithmetic coder110. The pre-processing performed by the coefficient pre-processor 108may also generally involve gathering context information from previoussections image for use in adaptively training the probability model usedby the arithmetic coder 110.

Example Applications

There are several useful applications for image recompression system102. In some implementations, image recompression system 102 is used tofurther compress original compressed image 104 before storage ortransmission of further compressed image 112. By doing so, networkresources that would otherwise be consumed by transmitting the largeroriginal compressed image 104 are conserved by transmitting instead thefurther compressed image 112. Similarly, storage resources that wouldotherwise be consumed storing the larger original compressed image 104are conserved by storing instead the further compressed image 112. Animage decompression system that essentially performs the inverse ofimage recompression system 102 may be used to recover the originalcompressed image 104 from the further compressed image 112.

Centrally Hosted Network Filesystem Application

In some implementations, image recompression system 102, and acorresponding image decompression system that essentially reverses therecompression applied by system 102, are used by a centrally hostednetwork filesystem that stores (hosts) users' digital photos and digitalimages to reduce the amount of data storage space required to store thedigital photos and digital images. In some implementations, the originalcompressed image 104 may be, for example, a digital photo captured by auser's mobile phone and uploaded to the online service. After receivingthe original compressed image 104, the image recompression system 102may be used to produce further compressed image 112 after which theoriginal compressed image data 104 may be discarded or archived. Whenthe user requests the original compressed image 104 from the networkfilesystem, the image decompression system may be used to reproduce therequested original compressed image 104 from the previously generatedand stored further compressed image 112. After storing furthercompressed image 112 and before the user requests to download originalcompressed image 104, only the further compressed image 112 may bestored and not the original compressed image 104 thereby conserving datastorage resources consumed by the network file system. By implementingrecompression techniques disclosed herein, a significant reduction inthe amount of data storage resources needed by the network filesystemmay be realized.

Distributed and Multithreaded Decompression

In some implementations, the image recompression system 102 and thecorresponding image decompression system execute on a cluster ofback-end servers. The image decompression system in some implementationsmay be configured to perform real-time distributed and multithreadeddecompression of a further compressed image 112. The decompression maybe capable of being distributed across segments of the furthercompressed image 112. The segments may be distributed across multipleback-end servers. Each segment may store a portion of the furthercompressed image 112 up to a maximum segment size such as, for example,4 Megabytes. The image decompression system is configured to decompresseach segment independently without access to the other segments.

Segments of an original compressed image 102 may be requested by aclient (e.g., over an Internet connection) individually andindependently of each other. When a segment of an original compressedimage 102 is requested, to begin streaming the requested segment as soonas possible and at a network transfer rate (e.g., greater than 100Megabits per second) that sufficiently utilizes the bandwidth client'sInternet connection, the decompression of a corresponding segment of thefurther compressed image 112 may be multithreaded. Specifically, eachthread may produce a portion of the requested segment of the originalcompressed image 102 from a portion of a corresponding segment of thefurther compressed image 112. The portions of the requested segmentproduced by the multiple threads may then be concatenated together toproduce the requested segment of the original compressed image 102.

Personal Computing Device Application

In some possible implementations, the image recompression system 102 andcorresponding image decompression system are similarly used at a clientcomputing device or at a personal computing device to similarly compressan original compressed image 104 to a corresponding further compressedimage 112 for storage at the device or transmission to another device.For example, an application (e.g., a web browser or mobile application)on a camera-equipped portable computing device may use imagerecompression system 102 to further compress an original compressedimage 104 produced by a camera module of the portable computing deviceand store the corresponding further compressed image 112 at the deviceinstead of storing the original compressed image 104 at the device. Thisconserves precious data storage resources of the portable computingdevice. When needed, the application may use the corresponding imagedecompression system to recover the original compressed image 104 fromthe further compressed image 112 stored at the device.

Web Browser Application

In some implementations, the image decompression system may beimplemented in a client-side browser-supported scripting language suchas JAVASCRIPT or the like to provide backward compatibility support fora further compressed image 112 in web browsers that are not configuredto decode the further compressed image 112. In some implementations, aserver can send scripting language instructions implementing the imagedecompression system and a further compressed image 112 to a client webbrowser (e.g., as part of a web page). The client web browser can thenexecute the scripting language instructions to obtain an originalcompressed image 104 (e.g., a baseline JPEG image) from the furthercompressed image 112 that the client web browser can decompress. Theclient web browser can then decompress the original compressed image 104to obtain an image that may be displayed in a video display.

Other Application Considerations

The above-described image recompression system 102 is presented forpurposes of illustrating some system implementations for the presentinvention. The present invention, however, is not limited to any systemor system configuration. An image recompression system or an imagedecompression system is not necessary to the invention, but is used toprovide a framework for discussion. Instead, the present invention maybe implemented in any type of system architecture or processingenvironment capable of supporting the methodologies of the presentinvention presented in detail herein.

In FIG. 1, for providing a clear example, various labeled boxes are usedto represent a set of related operations performed in software orhardware, or a combination thereof. For example, the box labeledcoefficient pre-processor 108 is used to represent operations disclosedherein in pre-processing an array of quantized coefficients forarithmetic coding. However, the labeled boxes may or may not have directsoftware and/or hardware structural correspondence in the implementationat hand. For example, what is structurally considered to be acoefficient pre-processor in the implementation at hand may perform someof the operations described herein as being performed by the entropydecoder 106 and/or the arithmetic coder 110, and/or vice versa.

Arithmetic Coding

Arithmetic coding is a technique for lossless data compression. Inarithmetic coding, generally, an entire data stream of binary symbols isrepresented as a single contiguous range on the number line between 0and 1. The binary fractional digits required to encode a point withinthe range can describe the data stream in its entirety.

One possible technique for arithmetically coding a data stream maysimply divide the number line in half recursively for each binary symbolencoded, with the lower half representing one binary symbol and theupper half representing the other binary symbol. This possible techniquemay require a final exponential range of the number line that yields nocompression. A less naïve technique may divide the number line intouneven ranges, where a larger range can be chosen beforehand for a morelikely upcoming binary symbol to be encoded. This technique is generallyknown as adaptive binary arithmetic coding.

With adaptive binary arithmetic coding, several semantically-awareprobability models may be maintained for various image situations thatmay arise. A range on the number line for upcoming binary symbols to beencoded may then be chosen based on the probability models. The rangechosen may depend on the image features already binarized. Such featuresmay include, for example, the magnitude of a previous error correctionterm on the brightness of a block. Probabilities may be tracked in amemory location indexed by the set of past features observed. Forexample, the magnitude of the previously binarized error term may becategorized into one of the following categories: zero, small positive,small negative, large positive, or large negative. Upon encounteringeach new binary symbol encoding the brightness error correction, one ofthe five memory locations may be chosen and statistics for eachsituation may be tracked separately. The currently selected memorylocation may drive the choice of how to divide the number line for thecurrent and upcoming binary symbols to be encoded.

Adaptively Trained Probability Model

The inventive techniques disclosed herein may encompass an arithmeticcoder that uses an adaptively trained probability model. The probabilitymodel may comprise locations in memory referred to herein as“statistical bins” or just “bins” for short. In some implementations ofthe present invention, the probability model consists of 721,564statistical bins. Each statistical bin tracks probabilities in a varietyof situations (i.e., probability contexts) for different types ofquantized coefficients in a block.

FIG. 2 schematically depicts a statistical bin 200 in memory. The bin200 may represent one of the 721,564 different situations in the image,for example. The bin 200 includes an 8-bit “zero” counter 202 thattracks the number of zero symbols encountered in the situation and an8-bit “one” counter 204 that tracks the number of one symbolsencountered in the situation. The bin 200 may be initialized with twosamples, one of each variety. If either the zero counter 202 or the onecounter 204 overflows, then both counters 202 and 204 may be divided bytwo and rounded up if necessary.

A probability estimate 206 may be computed from the counters 202 and 204by dividing the zero counter 202 by the sum of the zero counter 202 andthe one counter 204. The number line may then be cut so that the lengthof each split of the number line corresponds with the probabilityestimate 206.

As mentioned, the probability contexts represented by the statisticalbins 200 may encompass the type of DCT coefficient. For example, onetype of coefficient is the “DC” which represents the average brightnessor color over a sample block. Another type of coefficient is an “AC”coefficient. As described in greater detail below, a probability contextmay also encompass an index of AC coefficient within a DCT block.

Per some implementations of the present invention, each DCT coefficientis represented in a binarized form with an Exp-Golomb code or anExp-Golomb-like code discussed in greater detail below. A statisticalbin 200 is used to track the likelihood of a “one” symbol (e.g., a “one”bit) in the binarized form considering the values of already-encodedcoefficients that may be correlated.

Initially, the statistical bins 200 are each initialized to a 50-50probability of ones vs zeroes. The probabilities are then adapted as thecoefficients are encoded (or decoded), counting the number of ones andzeros seen in each of the probability contexts.

Statistical bins 200 may be independent such that a “one” symbolencountered in one probability context does not affect the predictionmay in another probability context. The number of arrangement ofstatistical bins is selected such that useful information is learnedfrom similar probability contexts.

Per some implementations of the present invention, for each block of 64quantized DCT coefficients corresponding to an 8×8 sample block of onecomponent of an image, 49 AC coefficients in a 7×7 sub-block, 14 “edge”AC coefficients of horizontal (1×7) and vertical (7×1) variation, and 1DC coefficient are separately encoded.

Per some implementations of the present invention, for an AC coefficientin the 7×7 sub-block, the bits of the binarized form of the ACcoefficient are predicted using the corresponding AC coefficient in anabove DCT block, a left DCT block, and an above-left DCT block. Forexample, the bins 200 for bits of the binarized form may be selectedbased on

i, └ log₂|A_(i)|┘, └ log₂|L_(i)|┘, └ log₂|AL_(i)|┘

. Here, i is an index of the AC coefficient within DCT block, A_(i)represents the coefficient at the same index in the above DCT block,L_(i) represents the coefficient at the same index in the left DCTblock, and AL_(i) represents the coefficient at the same index in theabove-left DCT block

Per some implementations of the present invention, for the and 7×1 edge,an entire column of a two dimensional (2-D) DCT is transformed into aone dimensional (1-D) DCT of an edge row. In this manner, pixel-adjacent1-D DCT coefficients are obtained from the lower-most row of the DCTblock above and the top row of the currently decoding DCT block.Likewise, for the 1×7 edge, the neighboring right most column of the DCTblock to the left may be used as a prior for the left most 1-D DCTcolumn of the currently decoding block.

Per some implementations of the present invention, to predict the DCcoefficient, it is assumed that image gradients across blocks aresmooth. Linearly extrapolating the last two rows of pixels of the aboveand left blocks yields 16 edge pixel values. AC coefficients are used tocompute a predicted DC offset which minimizes average differencesbetween the decoded block's edge pixels and the edges extrapolated fromneighbors. Only the delta between the predicted DC value and the true DCvalue is encoded, so close predictions yield small output sizes. Persome implementations, additional compressed gains are achieved byindexing the statistical bins by outlier values and the variance of edgepixels so to enable the probability model to adapt to non-smoothgradients.

Adaptively Trained Arithemtic Coding Procedure

As mentioned, the adaptively trained arithmetic coder of the presentinvention may encompass a probability model that is adaptively trainedby context information gathered from previous sections of the image.When encoding a given set of upcoming symbols, the arithmetic coder maycompute a probability estimate for diving the number line. Theprobability estimate may be computed based on the current zero and onecounters in a selected bin of the probability model. The statistical binto use for a given set of upcoming symbols may be determined based onthe current situation for the given set of upcoming symbols.

FIG. 3 is a flowchart of the high-level operations 302-314 involved inan adaptively trained arithmetic coding procedure per someimplementations of the present invention. While depicted in FIG. 3 anddescribed below in a certain order, performance of the operations302-314 may overlap in a implementation at hand. For example, operations302-3014 may be performed concurrently or in parallel in aimplementation at hand. Thus, there is no requirement that an operation(e.g., 302) must be performed to completion before performance of thenext depicted or described operation (e.g., 304) can begin, or even thatthe operations must begin in the order depicted.

Generally, the operations 302-314 are performed on an array of quantizedcoefficient blocks for a component of an image. If the image hasmultiple components (e.g., is a color image), then the operations302-314 may be performed separately for each component where eachcomponent is represented by a separate array of quantized coefficientblocks.

Quantized DCT Block Processing Order

At operation 302, blocks of quantized coefficients corresponding tosample blocks an image component are obtained for processing per theremaining operations 304-314. The quantized blocks may be obtained in araster scan order of left to right and top to bottom within thecomponent where the four sides of the component are designated as top,bottom, left, and right with bottom opposite top and left oppositeright. Because of the processing order, any quantized blocks “above” andto the “left” of a given quantized block are processed before the givenquantized block. Thus, information determined by processing the aboveand left quantized blocks is available when the given quantized block isprocessed, assuming the above and left blocks are available for thegiven block.

FIG. 4 schematically depicts an image component 400 having left, right,top, and bottom sides. Blocks of quantized coefficients corresponding tosample blocks of the component are processed in left to right, top tobottom order starting with the quantized block corresponding to sampleblock 402. A given quantized block may have a left block if thecorresponding sample block is not in the left-most block column of thecomponent. A given quantized block may have an above block if thecorresponding sample block is not in the top-most block row of thecomponent. A given quantized block may have an above-left block if thecorresponding sample block is not in the left-most block column and notin the top-most block column of the component. For example, sample block404 has an above block 408, a left block 406, and an above-left block410. However, block 402 does not have any of these blocks because of itsposition within the component.

Quantized Coefficient Block Break Down (Categorization)

At operation 304, blocks of quantized coefficients are broken down(categorized) into non-binary symbols. Per some implementations of thepresent invention, the quantized coefficients of a quantized block arebroken down into four general categories. The four general categorizesare illustrated in FIG. 5, which schematically depicts a block of 64quantized coefficients 500. The block 500 may be one of the blocks of 64quantized coefficients in the array of quantized coefficients recoveredfrom the original compressed image. The block 500 may have 63 quantizedAC coefficients (numbered 1 to 63 in FIG. 5) some or all of which mayhave a zero value because of quantization. The block 500 may also have aquantized DC coefficient 502 (numbered 64 in FIG. 5). The quantized DCcoefficient 502 may represent the overall brightness of the 8 by 8sample block of the image corresponding to the block 500. The higherquantized DC coefficient value, the brighter the samples of thecorresponding sample block.

The 63 quantized AC coefficients of the block 500 may be furthercategorized into three sub-portions: a 7×7 sub-block 504 (quantized ACcoefficients numbered 1-49 in FIG. 5), a 7×1 edge row 506 (quantized ACcoefficients numbered 50-56), and a 1×7 edge column 508 (quantized ACcoefficients numbered 57-63). The quantized AC coefficients of the 7×1edge row 506 may comprise vertical patterns that occur at variousincreasing frequencies as they proceed farther from the DC. Likewise,the quantized AC coefficients of the 1×7 edge column 508 may comprisehorizontal striped patterns of increasing frequency. The quantized ACcoefficients in the 7×7 sub-block 504 may comprise checkered patternsthat represent fine detail in the corresponding 8 by 8 sample block suchas, for example, the texture of pebbles on a beach, or the pattern on aplaid shirt.

Binarization

At operation 306, non-binary symbols in the quantized coefficient blocksare binarized. Binarization may involve converting a non-binary symbolinto a sequence of one or more binary symbols (e.g., a sequence of oneor more bits).

FIG. 6 schematically depicts a block binarization format 600 fornon-binary symbols of a given categorized quantized coefficient blockper some implementations of the present invention. The blockbinarization format 600 comprises a sequence of bits (binary symbols)starting a bit 0 and ending at bit N representing the non-binary symbolsof the given block. The block binarization format 600 for the givenblock, per some implementations, includes, in the order listed below, abinarized form of the following non-binary symbols:

-   -   the number of non-zero quantized AC coefficients 602 in the 7×7        sub-block 504,    -   followed by a number of quantized AC coefficients 604 from the        7×7 sub-block 504 where the number is greater than or equal to        the number of non-zero quantized AC coefficients 602 in the 7×7        sub-block 504,    -   followed by the number of non-zero quantized AC coefficients 606        in the 7×1 edge row 506,    -   followed by a number of quantized AC coefficients 608 from the        7×1 edge row 506 where the number is greater than or equal to        the number of non-zero quantized AC coefficients 606 in the 7×1        edge row 506,    -   followed by the number of non-zero quantized AC coefficients 610        in the 1×7 edge column 508,    -   followed by a number of quantized AC coefficients 612 from the        1×7 edge column 508 where the number is greater than or equal to        the number of non-zero quantized AC coefficients 610 in the 1×7        edge column 508, and    -   followed by a DC error term 614 which may be a delta of a        prediction for the quantized DC coefficient 502.

In some implementations, the number of non-zero quantized ACcoefficients 602 in the 7×7 sub-block 504 is from 0 and 49, inclusive,and binarized in the format 600 as a six-bit base-2 encoding of thenumber 602.

When binarizing the given block 500, the quantized AC coefficients ofthe 7×7 sub-block 504 may be binarized per a zig-zag scan order shown inFIG. 7, starting with the quantized AC coefficient numbered 1 in FIG. 7and proceeding as depicted toward the quantized AC coefficient numbered49 in FIG. 7. The zig-zag scan order allows fewer quantized ACcoefficients to be serialized than if they were serialized in a rasterscan order, thereby resulting in fewer symbols for the entropy coder toencode. Specifically, when serializing the quantized AC coefficients inthe 7×7 sub-block 504, in-memory counter may be set to the number ofnon-zero quantized AC coefficients 602 in the 7×7 sub-block 504. Thenumber of non-zero quantized AC coefficients 602 in the 7×7 sub-block504 may be determined prior to binarizing the given block 500. Forexample, the number of non-zero quantized AC coefficients 602 in the 7×7sub-block 504 may be determined when decoding the original compressedimage to recover the given block 500 from the original compressed image.

Assuming the number of non-zero quantized AC coefficients 602 in the 7×7sub-block 504 is greater than zero, the counter is decremented by oneeach time a non-zero quantized AC coefficient in the zig-zag scan orderthrough the 7×7 sub-block 504 is binarized. Binarization of the 7×7sub-block 504 may complete after the counter reaches zero. As anexample, FIG. 8 schematically depicts an example 7×7 sub-block 800 ofquantized AC coefficients having three non-zero AC coefficients atpositions 1, 3, and 6 in the zig-zag scan order. Because the number ofnumber of non-zero coefficients is known, serialization of the 7×7sub-block 800 can stop after the third non-zero AC coefficient isencountered at position 6 as shown in FIG. 8. Moreover, for thissub-block 800, only six quantized AC coefficients need be binarized 604in the format 600. Specifically, only the quantized AC coefficients atpositions 1 through 6, inclusive, need be binarized. If the number ofnon-zero quantized AC coefficients 602 in the 7×7 sub-block 504 is zero,then no quantized AC coefficients 602 in the 7×7 sub-block 504 need bebinarized in the format 600. This scenario is depicted in FIG. 6 byrepresenting the quantized AC coefficients in 7×7 sub-block 504 with adashed outlined box 604.

The 7×1 edge row 506 and the 1×7 edge column 508 may each be binarizedin a similar manner to the 7×7 sub-block 504. Except the number ofnon-zero quantized AC coefficients 606 in the 7×1 edge row 506 and thenumber of non-zero quantized AC coefficients 610 in the 1×7 edge column508 is a value in the range of 0 to 7, inclusive, and binarized in theformat 600 as a three-bit base-2 encoding instead of a six-bit base-2encoding. Another difference is that the scan order through these edgecoefficients may be straight and may not have a zig-zag pattern asdepicted in FIG. 7 with corresponding arrows through the sub-blocks 706and 708. Similar with the 7×7 sub-block 504, if the number of non-zerocoefficients in the 7×1 edge row 506 or the 1×7 sub-block 508 is zero,then binarization of the corresponding quantized AC coefficients inthose blocks is not necessary as depicted with dashed outline boxes 608and 612 in FIG. 6.

AC Coefficient and Dc Error Term Binarization Format

Per some implementations of the present invention, each quantized ACcoefficient 604, 608, 612 and the DC error term 614 are binarized in theblock binarization format 600 with a Exp-Golomb Code that is extended tonegative numbers by placing the sign bit directly after the unarylength. FIG. 9 schematically depicts the binarization format 900 usedfor the quantized AC coefficients and the DC error term. The format 900generally comprises a coefficient exponent 902, a sign bit 904, and aresidual 906.

In some implementations, the coefficient exponent 902 is unary valuerepresenting the bit length of the value represented by the residual906. The exponent 902 ends with a zero (0) terminal bit to signal theend of the unary value.

Next, a sign bit 904 is a binary value (zero or one) representingwhether the value represented by the residual 906 is a positive numberof a negative number. In some implementations, a one (1) bit value isused as the sign bit 904 for a positive number and a zero (0) bit valueis used as the sign bit 904 for a negative number.

Finally, the residual 906 is a binary value representing the value ofthe quantized AC coefficient or the DC error term. The leading, mostsignificant, binary digit of the residential 906 can be omitted, sincethe leading digit for all positive numbers will be one.

For example, per the format 900, the decimal number 47 may berepresented as the following sequence of bits: 1111110 0 01111. In thisexample, the residual 906 omits the leading one (1) bit. Also in thisexample, the exponent 902 is six (6) in unary to represent the bitlength of the complete binary value representation of 47 that comprisessix (6) bits (e.g., 101111). As can be seen by this example, theexponent 902 counts the leading one (1) bit that is omitted from theresidual 906.

Per some implementations, if the quantized AC coefficient or the DCerror term is zero (0), the format 900 is not used. Instead, a zero (0)value is simply binarized in the block format 600 as a single zero (0)bit. The following table shows how the numbers 0 through 9 may berepresented per format 900:

TABLE 1 Quantized AC Coefficient or DC Error Term Binarization ExamplesDecimal Value Binary 0 0 (bit) 1 10 0 2 110 0 0 3 110 0 1 4 1110 0 00 51110 0 01 6 1110 0 10 7 1110 0 11 8 11110 0 000 9 11110 0 001

Bin Selection

At operation 308, a bin of the probability model is selected for eachbinary symbol to be encoded. Selection may vary depending on a varietyof situational factors including whether the binary symbol binarizes anon-binary symbol from the 7 by 7 sub-block 504, the 7 by 1 edge row506, the 1 by 7 sub-block 508, or the DC error term.

Bin Selection for the 7 by 7 Sub-Block

For the six binary symbols encoding the number of non-zero coefficients602 in the 7 by 7 sub-block 504, the average of the number of non-zerocoefficients 602 in the 7 by 7 sub-block 504 of the above and leftblocks are used to select a bin index. This is mapped to a bin indexfrom 0 to 9 inclusive by taking the log_(1.59) of the average. Thesymbol index being encoded combined with the value having been encodedso far are combined with the average non-zero index to give the fullindex of the bin. The additional information about the number decodedthus far and the symbol index is sufficient for the arithmetic decoderto adaptively assign the lowest possible probabilities to values above49 non-zeros.

In this context, the term “combined” is used to mean the addition of twobin indices after one is scaled by the range of the other. For example,if index a ranges from 0 to 9 inclusive, and it is combined with anotherindex b, the result is defined to be a+10·b.

As discussed above, the 7 by 7 coefficients 604 are encoded using azig-zag scan that allows significantly fewer coefficients to be encodedthan if they were encoded using raster-scan order, resulting in a bettercompression. For each of the 7 by 7 coefficients 604, the neighboringthree quantized coefficients at the same zig-zag position in the 7 by 7block 504 from the left, above, and above-left blocks are averaged withweights of 13, 13, and 6 respectively. This allows approximately doublethe importance of the adjoining blocks while adding to 32 and allowing ashift operation to complete the averaging. The weighted average iscombined with log_(1.59) non-zeros remaining, the coefficient index, andhow many symbols of the coefficient exponent were coded so far toproduce a full bin index for each bit of the 7×7 quantized coefficientexponent 902. A bin is selected for the following sign bit 904 basedonly on the current component. Finally, the bin for the bits describingthe residual 906 are encoded using a bin index specified by thecomponent, the coefficient index from 0 to 48 inclusive, and thelog_(1.59) nonzeros_remaining.

Bin Selection for the 7 by 1 Edge Row and the 1 by 7 Sub-Block

The 7 by 1 category use similar bin indices with a few key differences.First, the number of non-zeros 606 in the 7 by 1 edge row 506 onlyrequires 3 binary symbols to describe, from zero to seven inclusive. Theprior here is a combination of the component and the number of non-zeros602 in the 7 by 7 sub-block 504 block divided by 7, and finally thefarthest horizontal coordinate of a non-zero in the 7 by 7 sub-block 504previously decoded.

For the actual quantized AC coefficients 608, the uth index left edgeDCT coefficient where u∈[1,8), may be predicted by using the remainderof the entire row at that index as well as the entire matching row fromthe neighboring block to the left.

Per some implementations of the present invention, the entire uth row of2-D DCT values is used to compute a corresponding coefficient of a 1-DDCT at the edge of the block. The same computation may be carried out toestablish the 1-D DCT for the adjacent block to the left for itsright-most (7th) pixel column. The uth index of the 1-D DCT of the 7thcolumn of the known previous block may be assumed to be similar or equalto the uth index of the left-most row of the current block, since all 8adjacent pixels tend to be similar. Thus, the final frequency spacevalue F_(0,u) can be estimated by subtracting the 1-D DCT of the 7thcolumn of the adjoining neighbor block to the left from the knownportion of the 1-D DCT of the left-most (0^(th)) column of the currentblock.

In detail, the basis elements of a DCT may be represented as:

${C_{u,x} = {{c(u)}{\cos\left( \frac{\left( {{2x} + 1} \right)u\;\pi}{16} \right)}\mspace{14mu}{with}\mspace{14mu} x}},{{u \in {\left\lbrack {0,8} \right)\mspace{14mu}{and}\mspace{14mu}{c(u)}}} = \left\{ \begin{matrix}{\frac{1}{2\sqrt{2}},{u = 0}} \\{\frac{1}{2},{u \neq 0}}\end{matrix} \right.}$

Thus, the cosine space values F_(u,v) where u, v∈[0,8) may be definedfrom the pixel space values p_(x,y) where x, y∈[0,8) may be representedas:F _(u,v)=Σ_(y=0) ⁷ C _(v,y)Σ_(x=0) ⁷ P _(x,y) C _(u,x)

The DCT may be defined such that it is orthogonal. Hence:

${\sum\limits_{x = 0}^{7}{C_{{u,x}\;}C_{v,x}}} = \left\{ \begin{matrix}{0,{u \neq v}} \\{1,{u = v}}\end{matrix} \right.$

The above-equation defining the cosine space values F_(u,v) may berepresented differently by multiplying both sides of the equation byΣ_(u=0) ⁷C_(v,y) to provide the following the relation:Σ_(y=0) ⁷ F _(u,y) C _(v,y)=Σ_(x=0) ⁷ p _(x,y) C _(u,x)

The above-relation may be interpreted such that a single 1-D DCTcoefficient of a column may be computed from the entire correspondingrow of the 2-D DCT of the block. Similarly, a single 1-D DCT coefficientof a row may be computed from the corresponding column of the 2-D DCT ofthe block.

Because the 1-D DCT values of neighboring rows in neighboring sampleblocks are likely to be similar, the uth edge value, F_(u,0), can berepresented by the following relation. In the following relation,F_(u,v) represents the 2-D DCT coefficient at location u, v and A_(u,v)represents the 2-D DCT coefficient at the location:Σ_(y=0) ⁷ F _(u,y) C _(0,y) =F _(u,0) C _(0,0)+Σ_(y=1) ⁷ F _(u,y) C_(0,y)≈Σ_(y=0) ⁷ A _(u,y) C _(7,y)

When predicting F_(u,0), the exponent of the following relation is fedas a bin index for the exponent.

$F_{u,0} \approx \frac{{\sum\limits_{y = 0}^{7}{A_{u,y}C_{7,y}}} - {\sum\limits_{y = 1}^{7}{F_{u,y}C_{0,y}}}}{C_{0,0}}$

That bin index of the exponential of the predicted value is combinedwith the component, the number of non-zeros remaining in the row, thecoefficient index, and the index of the current unary bit of theexponent. The sign of the prediction can also be used as a bin index forthe sign of F_(u,0). The value is, in general, useful for predicting thefirst 7 bits of the residual values. Thus, for the first 7 bits, the binindex includes the 7 most significant bits of the predicted F_(u,0) inaddition to the component and the quantized coefficient's exponent.

Techniques analogous to those described above applied to the horizontal7 by 1 column may also be applied to the vertical 1 by 7 row ofquantized coefficients.

Bins for Predicting the DC Error Term

With all 63 of the AC coefficient known, the last element to predict isthe DC coefficient. Instead of encoding the DC coefficient directly, aprediction is made. The delta between the prediction and the DCcoefficient, known as the DC error term, is encoded instead. The DCerror term may be encoded with bin indices corresponding to thecertainty of the prediction.

The bin indices of the DC error term may be set as the combination ofthe log₂ of the difference between the maximum and minimum prediction,as well as the log₂ of the prediction farthest from the average. Thesign of the prediction farthest from the average may also be sued as thesole bin index for the sign bit of the DC error term. Finally, theresidual of the DC error term may use only the length of the differencebetween the maximum and minimum prediction as its bin index foraccumulating probability counts.

Returning to FIG. 3, at operation 310, current probability estimates arecomputed from selected bins for binary symbols to be encoded. To computea probability estimate from a selected bin for a binary symbol to beencoded, the current zero counter of the selected bin may be divided bythe sum of the current zero counter and the current one counter.Alternatively, the current one counter of the selected bin may bedivided the sum. In either case, the probability estimate represents theprobability that the binary symbol to be encoded is a zero symbol or aone symbol and one minus the probability estimate represents theprobability that the binary symbol to be encoded is the other of thezero symbol or the one symbol. The probability estimate may be used toidentify a proportional sub-interval of a current interval whenarithmetically encoding the binary symbol.

At operation 312, the binary symbols are arithmetically encoded based onthe current probability estimates of the selected bins. A probabilityestimate may supply the probability that the current binary symbol is a“0” or a “1”. From the probability estimate, the probability that thecurrent binary symbol is the other of the “0” or the “1” can bedetermined. These two probabilities estimates may be used to determinethe two sub-ranges corresponding to the “0” and “1” binary symbols thatthe arithmetic coder uses to encode the current binary symbol.

Basically, arithmetically encoding a binary symbol at operation 312 maystart from a current interval. For the first binary symbol beingencoded, the current interval is initialized to [0, 1). The currentinterval is then subdivided into two sub-intervals, one sub-interval forthe “one” symbol and the other sub-interval for the “zero” symbol. Thesubdivision of the current interval is based on the probability estimatecomputed for binary symbol being encoded. Specifically, the size of thesub-interval for the “one” symbol and the size of the sub-interval forthe “zero” symbol is proportional to the estimated the probability thatthat symbol is the binary symbol being encoded. The subintervalcorresponding the binary symbol being encoded is selected and thatsubinterval becomes the new current interval for the next binary symbolto encode, if there is one. As an alternative to computing bothsubintervals of the current interval based on the probability estimate,only the subinterval corresponding to the binary symbol being encodedneed be computed. The final subinterval corresponding to the last binarysymbol encoded is then represented with enough bits sufficient todistinguish it from all other possible final intervals.

At operation 314, the selected bins of the probability model areupdated. For example, if a bin is selected for a given binary symbol andthe value of the binary symbol is “0”, then the zero counter of theselected bin is incremented. Thus, the next time the bin is selected,the probability of a “0” is slightly higher.

DC Error Term

In accordance with some implementations of the present invention, aprediction of the DC coefficient is computed and the difference (DCerror term) between the actual DC coefficient and the prediction isencoded. By encoding the DC error term in place of the actual DCcoefficient, further compression is achieved. The actual DC coefficientcan be recovered by during decompression by generating the predictionagain and combining it with the DC error term encoded in the furthercompressed image.

A goal is to generate an accurate prediction that minimizes thenumerical difference between the prediction and the actual DCcoefficient. In general, the smaller the difference (i.e., the moreaccurate the prediction), then the fewer number of bits required toencode the difference in the further compressed image. On average, theencoding of the DC coefficients can account for as much as approximately8% of the total data size of an original compressed image. Thus,generating predictions that are more accurate on average than thepredictions of an original entropy encoder can result in significantadditional compression.

In general, two different prediction methodologies are provided. A firstprediction methodology is referred to herein as a “local brightnessprediction.” The second prediction methodology is referred to herein asa “local gradient prediction.” Both methodologies are based generally onsamples in the block of samples corresponding to the target quantizedDCT block for a component, neighboring samples in the block of samplescorresponding to the quantized DCT block above the target quantized DCTblock for the same component, and neighboring samples in the block ofsamples corresponding to the quantized DCT block left of the targetquantized DCT block for the same component.

If the above block of samples is not available because the target blockof samples corresponds to the first row of blocks of the component, thenthe prediction may be based on just samples in the target sample blockand the left sample block. If the left sample block is not availablebecause the target sample block corresponds to the first column ofblocks of the component, then the prediction may be based on justsamples in the target sample block and samples in the above sampleblock. If both the above block and the left block are not availablebecause the target sample block corresponds to the top-left block of thecomponent, then, in some implementations, no prediction is generated.

In some implementations, if one or both above and left sample blocks arenot available, then a different prediction methodology is used or noprediction is made. More generally, the local brightness predictionmethodology and the local gradient prediction methodology describedherein may be used in place of, or in conjunction with, other quantizedDC coefficient prediction methodologies. Further, different predictionmethodologies may be used for different target quantized DCT blocks. Forexample, an additional process may determine that the local brightnessprediction methodology or another methodology is more appropriate (e.g.,is estimated to make a more accurate prediction) than the local gradientprediction methodology for a given target quantized DCT block and thatprediction methodology may be used to generate the prediction for thegiven block instead of using the local gradient prediction methodologyfor the given block.

In some implementations, multiple prediction methodologies are used fora given block to generate multiple predictions and the predictionestimated to be the most accurate is used for the given block. Forexample, the local brightness and the local gradient predictionmethodologies may both be used for a given block and the predictionestimated to be most accurate may be used as the prediction for thegiven block.

The terms “above” and “left” are defined by the order in which thequantized DCT blocks for a component are processed by the DCT-basedencoder. In general, the processing order is left to right and top tobottom within the component where the four sides of the component aredesignated as top, bottom, left, and right with bottom opposite top andleft opposite right. Because of the processing order, any quantized DCTblocks of a component “above” (i.e., nearer to the top of the component)and to the left of a target quantized DCT block of the component areprocessed before the target quantized DCT block. Thus, informationdetermined by processing the above and left quantized DCT blocks isavailable when the target quantized DCT block is processed, assuming theleft and above blocks are available for the target block.

Local Brightness Prediction Methodology

The local brightness prediction methodology computes as the predictionthe overall brightness that minimizes the differences between allsixteen pairs of samples at the edges between the target block ofsamples and both the left and above blocks of samples. This isillustrated in FIG. 10. As shown, a target 8 by 8 block of samples 1002has a leftmost column of samples comprising samples T0,0 through T0,7.Here, the letter “T” is used to refer to a sample in the target block ofsamples 1002 and “X, Y” are integers used to refer to the sample in X-thcolumn and the Y-th row of the target block 1002. Target block 1002 alsohas a top row of samples comprising samples T0,0 through T7,0. Theremaining cells of target block 1002 also have samples but are notdesignated as such in FIG. 10 for purposes of providing a clear example.Similarly, left block 1004 has a rightmost column of samples comprisingsamples L7,0 through L7,7. Here, the letter “L” is used to refer to asample in the left block of samples 1004. Similarly, above block 1006has a bottommost row of samples comprising samples A0,7 through A7,7.Here, the letter “A” is used to refer to a sample in the above block ofsamples 1006. Like target block 1002, left block 1004 and above block1006 also have samples in their remaining cells that are not explicitlydesignated in FIG. 10.

Turning now to FIG. 11, it is a flowchart 1100 of the high-leveloperations of the local brightness prediction methodology for generatinga prediction for the quantized DC coefficient of a target quantized DCTblock for a component per some implementations of the present invention.Generally, operations 1102, 1104, 1106, 1108, and 1110 may be performedfor each target quantized DCT block for a component for which the abovequantized DCT block and the left quantized DCT block for the componentare available in the processing order. To provide a clear example, theoperations of the methodology are described below regarding FIG. 10. Themethodology may be implemented in software, hardware, or a combinationof software and hardware per the requirements of the implementation athand.

At operation 1102, the target sample block 1002, the left sample block1004, and the above sample block 1006 are obtained. The target sampleblock 1002 may be obtained by applying the inverse DCT to a dequantizedDCT block corresponding to the target quantized DCT block where the DCcoefficient is set to a predetermined dummy value in the correspondingdequantized DCT block to which the inverse DCT is applied. In someimplementations, the predetermined dummy value for the DC coefficient iszero (0). The output of the inverse DCT with this input is the targetsample block 1002. The corresponding dequantized DCT block may beobtained from the target quantized DCT block by dequantizing thequantized DCT coefficients of the target quantized DCT block. Thedequantization may be based on the same or equivalent quantization tableused to originally quantize the target DCT block. The DC coefficient isset to a predetermined dummy value in the corresponding dequantized DCTblock input to the inverse DCT to represent the prediction being madeand because access to the actual quantized DC coefficient for the targetquantized DCT block is not available to the inverse coefficientpre-processor during decoding or decompression.

In some implementations, the samples output by the inverse DCT are firstinverse level shifted to produce the target sample block 1002 such thateach sample in the target sample block 1002 is a N-bit valuerepresenting an unsigned integer. Here, N may be 2, 4, 8, 10, or 12, forexample.

The left sample block 1004 and the above sample block 1006 may besimilarly obtained by applying the inverse DCT to the correspondingdequantized DCT blocks. However, for the left and above sample blocks1004 and 1006, the dequantized DC coefficients are retained in thecorresponding dequantized DCT blocks input to the inverse DCT. Thesedequantized DC coefficients are not set to a dummy value as is done withthe target quantized DCT block as these coefficients are available tothe inverse coefficient pre-processor by the time the target quantizedDCT block is processed in the processing order. Like the samples for thetarget block 1002, samples for the left and above blocks 1004 and 1006output by the inverse DCT may also first be inverse level shifted.

At operation 1104, sample differences are computed along the edgesbetween the target sample block 1002 and each of the left sample block1004 and the above sample block 1006 for a total of sixteen (16) sampledifferences. Specifically, the following sixteen (16) sample differencesmay be computed in some implementations:

TABLE 2 Sample Differences for Local Brightness Prediction Left BorderAbove Border ABS(T0.0 − L7.0) = DIFF1 ABS(T0.0 − A0.7) = DIFF9 ABS(T0.1− L7.1) = DIFF2 ABS(T1.0 − A1.7) = DIFF10 ABS(T0.2 − L7.2) = DIFF3ABS(T2.0 − A2.7) = DIFF11 ABS(T0.3 − L7.3) = DIFF4 ABS(T3.0 − A3.7) =DIFF12 ABS(T0.4 − L7.4) = DIFF5 ABS(T4.0 − A4.7) = DIFF13 ABS(T0.5 −L7.5) = DIFF6 ABS(T5.0 − A5.7) = DIFF14 ABS(T0.6 − L7.6) = DIFF7ABS(T6.0 − A6.7) = DIFF15 ABS(T0.7 − L7.7) = DIFF8 ABS(T7.7 − A7.7) =DIFF16

The ABS in the above table refers to the absolute value of thedifference.

At operation 1106, the mean of the sixteen (16) differences is computed.

At operation 1108, one or more of the sixteen (16) differences that arefurthest from the mean computed at operation 1106 are discarded forpurposes of making the prediction. In some implementations, a fixednumber of outliers are identified. For example, of the sixteen (16)differences, the eight (8) that are furthest from the mean may beidentified as outliers and discarded.

At operation 1110, the average of the remaining differences is computedafter the outliers are discarded at operation 1108. The computed averageis used as the prediction of the quantized DC coefficient of the targetquantized DCT block.

In a variation on the local brightness prediction approach, the averageof each of the sixteen (16) pairs of samples along the left and topborders is computed. For example, one of the sixteen averages would bethe average of sample pair {T7,3}, {T0,3} along the left border. Themedian of the sixteen averages is then computed and the average of theeight averages closest to the median is computed and used as theprediction, ignoring the eight averages farther from the median.

The local brightness prediction approach or its variation can make amore accurate prediction when the image has abrupt edges at the bordersbetween the target sample block 1002 and the left sample block 1004 andthe above sample block 1006. However, many images have smooth gradientsthat cross sample block edge boundaries. For example, a photographicimage of a sunset may have smooth gradients that cross sample block edgeboundaries in the image where the sky fades from blue to orange at thehorizon. To make a more accurate prediction for images having smoothgradients, the local gradient prediction approach may be used.

Local Gradient Prediction Methodology

The local gradient prediction methodology takes advantage of theindependence of the difference between a pair of neighboring samples(i.e., the gradient) in a block of samples being independent of thebrightness of the sample block. As such, gradients in the target sampleblock can be used to compute a prediction of the quantized DCcoefficient of the target quantized DCT block. Per some implementations,bordering gradients from the left sample block and the above sampleblock are also used to compute the prediction. This is illustrated inFIG. 12A. As shown, a target 8×8 block 1202 of samples has two left-mostvertical columns 1210 and two top-most horizontal rows 1212. The left8×8 block 1204 of samples has two right-most vertical columns 1208bordering vertical columns 1210 of the target block 1202. The above 8×8block 1206 of samples has two bottom-most horizontal rows 1214 borderinghorizontal rows 1212 of the target block 1202.

In general, the local gradient prediction methodology computes thedifferences between the left block's 1204 horizontal gradients and thetarget block's 1202 corresponding horizontal gradients and computes thedifferences between above block's 1206 vertical gradients and the targetblock's 1204 corresponding vertical gradients. Here, the left block's1204 horizontal gradients are computed as the differences betweensamples in the rightmost columns 1208 of the left block 1204, the aboveblock's 1206 vertical gradients are computed as the differences betweensamples in the bottommost rows 1214 of the above block 1206, the targetblock's 1202 horizontal gradients are computed as the differencesbetween samples in the leftmost columns 1210 of the target block 1202,and the target block's 1202 vertical gradients are computed as thedifferences between samples in the topmost rows 1212 of the target block1202.

Each difference between corresponding gradients is taken as a gradientdifference. The gradient difference is a positive or a negative valuedepending on the directions and magnitude of the corresponding gradientstoward the edge or zero if the direction and magnitudes are equal. Thus,corresponding gradients having the same or similar direction andmagnitude tend to cancel each other out. However, images tend to havesmooth gradients. A positive or negative (i.e., non-zero) value of thegradient difference reflects this. This is illustrated in FIG. 12B. Theshaded arrow 1216 represents a horizontal gradient in the left block1204 toward the edge between the left block 1204 and the target block1202 and the shaded arrow 1218 represents the corresponding horizontalgradient in the target block 1202 toward the edge between the left block1204 and the target block 1202. Here, the horizontal gradient 1216 maybe computed as the difference toward the edge between the left block1204 and the target block 1202 between samples L6,1 and L7,1 (e.g., L6,1minus L7,1) and the corresponding horizontal gradient 1218 may becomputed as the difference toward the edge between samples T1,1 and T0,1(e.g., T1,1 minus T,01). In the FIG. 12C, shaded arrow 1220 represent avertical gradient in the above block 1206 toward the edge between theabove block 1206 and the target block 1202 and shaded arrow 1222represents the corresponding vertical gradient in the target block 1202toward the edge.

If a gradient (e.g., 1216) is a negative value, then the component isincreasing in intensity toward the edge in the samples differenced tocompute the gradient. Conversely, if a gradient is a positive value,then the component is decreasing in intensity toward the edge in thedifferenced samples. If a gradient is zero, then the component has aconstant intensity toward the edge in the differenced samples.

As mentioned, the difference between a gradient and its opposinggradient may be taken as a gradient difference. In some implementations,the actual local gradient prediction of the quantized DC coefficient iscomputed as the average of all sixteen (16) gradient differences. Thelocal gradient prediction is on average more accurate than theprediction generated by the local brightness approach because on averageimages have more smooth gradients crossing sample block boundaries thanabrupt edges at the boundaries.

Turning now to FIG. 13, it is a flowchart 1300 of the high-leveloperations of the local gradient prediction methodology for generating aprediction for the quantized DC coefficient of a target quantized DCTblock for a component per some implementations of the present invention.Generally, operations 1302, 1304, 1306, 1308, and 1310 may be performedfor each target quantized DCT block for a component for which the abovequantized DCT block and the left quantized DCT block for the componentare available in the processing order. To provide a clear example, theoperations of the methodology are described below regarding FIG. 12A.The methodology may be implemented by the coefficient pre-processor andthe inverse coefficient pre-processor and may be implemented insoftware, hardware, or a combination of software and hardware per therequirements of the implementation at hand.

At operation 1302, the target sample block 1202, the left sample block1204, and the above sample block 1206 are obtained. These blocks may beobtained in a manner like the way blocks 1002, 1004, and 1006 areobtained at operation 1102 of the local brightness predictionmethodology. The inverse DCT may be applied the correspondingdequantized DCT blocks. Like at operation 1102, the DC coefficient ofthe dequantized DCT block corresponding to the target block 1202 is setto a dummy value, e.g., zero (0), before the inverse DCT is applied tothe dequantized DCT block with the dummy value for the DC coefficient.Also like operation 1102, the DC coefficients of the dequantized DCTblocks corresponding to the left 1204 and above 1206 blocks are notreplaced before undergoing the inverse DCT.

At operation 1304, the thirty-two (32) edge gradients are computed asspecified in the following table. Each gradient is directional.Specifically, toward the edge between the left block 1204 and the targetblock 1202 in the case of the horizontal gradients and toward the edgebetween the above block 1206 and the target block 1202 in the case ofthe vertical gradients.

TABLE 3 Edge Gradients Left Horizontal Right Horizontal Top VerticalBottom Vertical Edge Gradients Edge Gradients Edge Gradients EdgeGradients L6.0 − L7.0 = G0 T1.0 − T0.0 = G8 A0.6 − A0.7 = G16 T0.1 −T0.0 = G24 L6.1 − L7.1 = G1 T1.1 − T0.1 = G9 A1.6 − A1.7 = G17 T1.1 −T1.0 = G25 L6.2 − L7.2 = G2 T1.2 − T0.2 = G10 A2.6 − A2.7 = G18 T2.1 −T2.0 = G26 L6.3 − L7.3 = G3 T1.3 − T0.3 = G11 A3.6 − A3.7 = G19 T3.1 −T3.0 = G27 L6.4 − L7.4 = G4 T1.4 − T0.4 = G12 A4.6 − A4.7 = G20 T4.1 −T4.0 = G28 L6.5 − L7.5 = G5 T1.5 − T0.5 = G13 A5.6 − A5.7 = G21 T5.1 −T5.0 = G29 L6.6 − L7.6 = G6 T1.6 − T0.6 = G14 A6.6 − A6.7 = G22 T6.1 −T6.0 = G30 L6.7 − L7.7 = G7 T1.7 − T0.7 = G15 A7.6 − A7.7 = G23 T7.1 −T7.0 = G31

Each of the gradients in the above table is zero or a positive ornegative value depending on whether the gradient increases toward theedge (a negative value) or decreases toward the edge (a positive value)or remains constant (zero).

At operation 1306, the differences between corresponding gradients arecomputed as sixteen (16) gradient differences as specified in thefollowing table.

TABLE 4 Gradient Differences Horizontal Gradient Differences VerticalGradient Differences GDIFF0 = G0 − G8 GDIFF8 = G16 − G24 GDIFF1 = G1 −G9 GDIFF9 = G17 − G25 GDIFF2 = G2 − G10 GDIFF10 = G18 − G26 GDIFF3 = G3− G11 GDIFF11 = G19 − G27 GDIFF4 = G4 − G12 GDIFF12 = G20 − G28 GDIFF5 =G5 − G13 GDIFF13 = G21 − G29 GDIFF6 = G6 − G14 GDIFF14 = G22 − G30GDIFF7 = G7 − G15 GDIFF15 = G23 − G31

In the above table, the horizontal and vertical gradients are computedas part of operation 1304. Each gradient difference is a positive or anegative value if the corresponding gradients do not equally oppose eachother and zero if they do.

At operation 1308, the sum of the sixteen (16) gradient differences iscomputed.

At operation 1310, the average of the sum computed at operation 1308 iscomputed. The computed average may be used as the prediction of thequantized DC coefficient for the target quantized DCT block.

While in some implementations such as those discussed above a predictionis computed for a quantized DC coefficient as opposed to thecorresponding dequantized DC coefficient, the prediction is computed forthe dequantized DC coefficient as opposed to the corresponding quantizedDC coefficient in some implementations. Note that in both cases theprediction is computed the same way based on dequantized DCTcoefficients that are transformed to samples by the inverse DCT. In thecase the prediction is for the dequantized DC coefficient, the actualdequantized DC coefficient can be recovered by the inverse coefficientpre-processor by combing its own generated prediction with the deltaencoded in the further compressed image. In either case, the predictionis sufficiently accurate because of the small quantization step sizetypically used to quantize DC coefficients.

Basic Computing Device

Referring now to FIG. 14, it is a block diagram that illustrates a basiccomputing device 1400 in which the example embodiment(s) of the presentinvention may be embodied. Computing device 1400 and its components,including their connections, relationships, and functions, is meant tobe exemplary only, and not meant to limit implementations of the exampleembodiment(s). Other computing devices suitable for implementing theexample embodiment(s) may have different components, includingcomponents with different connections, relationships, and functions.

Computing device 1400 may include a bus 1402 or other communicationmechanism for addressing main memory 1406 and for transferring databetween and among the various components of device 1400.

Computing device 1400 may also include one or more hardware processors1404 coupled with bus 1402 for processing information. A hardwareprocessor 1404 may be a general-purpose microprocessor, a system on achip (SoC), or another processor.

Main memory 1406, such as a random-access memory (RAM) or other dynamicstorage device, also may be coupled to bus 1402 for storing informationand software instructions to be executed by processor(s) 1404. Mainmemory 1406 also may be used for storing temporary variables or otherintermediate information during execution of software instructions to beexecuted by processor(s) 1404.

Software instructions, when stored in storage media accessible toprocessor(s) 1404, render computing device 1400 into a special-purposecomputing device that is customized to perform the operations specifiedin the software instructions. The terms “software”, “softwareinstructions”, “computer program”, “computer-executable instructions”,and “processor-executable instructions” are to be broadly construed tocover any machine-readable information, whether or not human-readable,for instructing a computing device to perform specific operations, andincluding, but not limited to, application software, desktopapplications, scripts, binaries, operating systems, device drivers, bootloaders, shells, utilities, system software, JAVASCRIPT, web pages, webapplications, plugins, embedded software, microcode, compilers,debuggers, interpreters, virtual machines, linkers, and text editors.

Computing device 1400 also may include read only memory (ROM) 1408 orother static storage device coupled to bus 1402 for storing staticinformation and software instructions for processor(s) 1404.

One or more mass storage devices 1410 may be coupled to bus 1402 forpersistently storing information and software instructions on fixed orremovable media, such as magnetic, optical, solid-state,magnetic-optical, flash memory, or any other available mass storagetechnology. The mass storage may be shared on a network, or it may bededicated mass storage. Typically, at least one of the mass storagedevices 1410 (e.g., the main hard disk for the device) stores a body ofprogram and data for directing operation of the computing device,including an operating system, user application programs, driver andother support files, as well as other data files of all sorts.

Computing device 1400 may be coupled via bus 1402 to display 1412, suchas a liquid crystal display (LCD) or other electronic visual display,for displaying information to a computer user. In some configurations, atouch sensitive surface incorporating touch detection technology (e.g.,resistive, capacitive, etc.) may be overlaid on display 1412 to form atouch sensitive display for communicating touch gesture (e.g., finger orstylus) input to processor(s) 1404.

An input device 1414, including alphanumeric and other keys, may becoupled to bus 1402 for communicating information and command selectionsto processor 1404. In addition to or instead of alphanumeric and otherkeys, input device 1414 may include one or more physical buttons orswitches such as, for example, a power (on/off) button, a “home” button,volume control buttons, or the like.

Another type of user input device may be a cursor control 1416, such asa mouse, a trackball, or cursor direction keys for communicatingdirection information and command selections to processor 1404 and forcontrolling cursor movement on display 1412. This input device typicallyhas two degrees of freedom in two axes, a first axis (e.g., x) and asecond axis (e.g., y), that allows the device to specify positions in aplane.

While in some configurations, such as the configuration depicted in FIG.14, one or more of display 1412, input device 1414, and cursor control1416 are external components (i.e., peripheral devices) of computingdevice 1400, some or all of display 1412, input device 1414, and cursorcontrol 1416 are integrated as part of the form factor of computingdevice 1400 in other configurations.

Functions of the disclosed systems, methods, and modules may beperformed by computing device 1400 in response to processor(s) 1404executing one or more programs of software instructions contained inmain memory 1406. Such software instructions may be read into mainmemory 1406 from another storage medium, such as storage device(s) 1410.Execution of the software instructions contained in main memory 1406cause processor(s) 1404 to perform the functions of the exampleembodiment(s).

While functions and operations of the example embodiment(s) may beimplemented entirely with software instructions, hard-wired orprogrammable circuitry of computing device 1400 (e.g., an ASIC, a FPGA,or the like) may be used in other embodiments in place of or incombination with software instructions to perform the functions, per therequirements of the implementation at hand.

The term “storage media” as used herein refers to any non-transitorymedia that store data and/or software instructions that cause acomputing device to operate in a specific fashion. Such storage mediamay comprise non-volatile media and/or volatile media. Non-volatilemedia includes, for example, non-volatile random access memory (NVRAM),flash memory, optical disks, magnetic disks, or solid-state drives, suchas storage device 1410. Volatile media includes dynamic memory, such asmain memory 1406. Common forms of storage media include, for example, afloppy disk, a flexible disk, hard disk, solid-state drive, magnetictape, or any other magnetic data storage medium, a CD-ROM, any otheroptical data storage medium, any physical medium with patterns of holes,a RAM, a PROM, and EPROM, a FLASH-EPROM, NVRAM, flash memory, any othermemory chip or cartridge.

Storage media is distinct from but may be used in conjunction withtransmission media. Transmission media participates in transferringinformation between storage media. For example, transmission mediaincludes coaxial cables, copper wire and fiber optics, including thewires that comprise bus 1402. Transmission media can also take the formof acoustic or light waves, such as those generated during radio-waveand infra-red data communications.

Various forms of media may be involved in carrying one or more sequencesof one or more software instructions to processor(s) 1404 for execution.For example, the software instructions may initially be carried on amagnetic disk or solid-state drive of a remote computer. The remotecomputer can load the software instructions into its dynamic memory andsend the software instructions over a telephone line using a modem. Amodem local to computing device 1400 can receive the data on thetelephone line and use an infra-red transmitter to convert the data toan infra-red signal. An infra-red detector can receive the data carriedin the infra-red signal and appropriate circuitry can place the data onbus 1402. Bus 1402 carries the data to main memory 1406, from whichprocessor(s) 1404 retrieves and executes the software instructions. Thesoftware instructions received by main memory 1406 may optionally bestored on storage device(s) 1410 either before or after execution byprocessor(s) 1404.

Computing device 1400 also may include one or more communicationinterface(s) 1418 coupled to bus 1402. A communication interface 1418provides a two-way data communication coupling to a wired or wirelessnetwork link 1420 that is connected to a local network 1422 (e.g.,Ethernet network, Wireless Local Area Network, cellular phone network,Bluetooth wireless network, or the like). Communication interface 1418sends and receives electrical, electromagnetic, or optical signals thatcarry digital data streams representing various types of information.For example, communication interface 1418 may be a wired networkinterface card, a wireless network interface card with an integratedradio antenna, or a modem (e.g., ISDN, DSL, or cable modem).

Network link(s) 1420 typically provide data communication through one ormore networks to other data devices. For example, a network link 1420may provide a connection through a local network 1422 to a host computer1424 or to data equipment operated by an Internet Service Provider (ISP)1426. ISP 1426 in turn provides data communication services through theworld-wide packet data communication network now commonly referred to asthe “Internet” 1428. Local network(s) 1422 and Internet 1428 useelectrical, electromagnetic or optical signals that carry digital datastreams. The signals through the various networks and the signals onnetwork link(s) 1420 and through communication interface(s) 1418, whichcarry the digital data to and from computing device 1400, are exampleforms of transmission media.

Computing device 1400 can send messages and receive data, includingprogram code, through the network(s), network link(s) 1420 andcommunication interface(s) 1418. In the Internet example, a server 1430might transmit a requested code for an application program throughInternet 1428, ISP 1426, local network(s) 1422 and communicationinterface(s) 1418.

The received code may be executed by processor 1404 as it is received,and/or stored in storage device 1410, or other non-volatile storage forlater execution.

Basic Software System

FIG. 15 is a block diagram of a basic software system 1500 that may beemployed for controlling the operation of computing device 1400.Software system 1500 and its components, including their connections,relationships, and functions, is meant to be exemplary only, and notmeant to limit implementations of the example embodiment(s). Othersoftware systems suitable for implementing the example embodiment(s) mayhave different components, including components with differentconnections, relationships, and functions.

Software system 1500 is provided for directing the operation ofcomputing device 1400. Software system 1500, which may be stored insystem memory (RAM) 1406 and on fixed storage (e.g., hard disk or flashmemory) 1410, includes a kernel or operating system (OS) 1510.

The OS 1510 manages low-level aspects of computer operation, includingmanaging execution of processes, memory allocation, file input andoutput (I/O), and device I/O. One or more application programs,represented as 1502A, 1502B, 1502C . . . 1502N, may be “loaded” (e.g.,transferred from fixed storage 1410 into memory 1406) for execution bythe system 1500. The applications or other software intended for use ondevice 1500 may also be stored as a set of downloadablecomputer-executable instructions, for example, for downloading andinstallation from an Internet location (e.g., a Web server, an appstore, or other online service).

Software system 1500 includes a graphical user interface (GUI) 1515, forreceiving user commands and data in a graphical (e.g., “point-and-click”or “touch gesture”) fashion. These inputs, in turn, may be acted upon bythe system 1500 in accordance with instructions from operating system1510 and/or application(s) 1502. The GUI 1515 also serves to display theresults of operation from the OS 1510 and application(s) 1502, whereuponthe user may supply additional inputs or terminate the session (e.g.,log off).

OS 1510 can execute directly on the bare hardware 1520 (e.g.,processor(s) 1404) of device 1400. Alternatively, a hypervisor orvirtual machine monitor (VMM) 1530 may be interposed between the barehardware 1520 and the OS 1510. In this configuration, VMM 1530 acts as asoftware “cushion” or virtualization layer between the OS 1510 and thebare hardware 1520 of the device 1400.

VMM 1530 instantiates and runs one or more virtual machine instances(“guest machines”). Each guest machine comprises a “guest” operatingsystem, such as OS 1510, and one or more applications, such asapplication(s) 1502, designed to execute on the guest operating system.The VMM 1530 presents the guest operating systems with a virtualoperating platform and manages the execution of the guest operatingsystems.

In some instances, the VMM 1530 may allow a guest operating system torun as if it is running on the bare hardware 1520 of device 1400directly. In these instances, the same Revision of the guest operatingsystem configured to execute on the bare hardware 1520 directly may alsoexecute on VMM 1530 without modification or reconfiguration. In otherwords, VMM 1530 may provide full hardware and CPU virtualization to aguest operating system in some instances.

In other instances, a guest operating system may be specially designedor configured to execute on VMM 1530 for efficiency. In these instances,the guest operating system is “aware” that it executes on a virtualmachine monitor. In other words, VMM 1530 may providepara-virtualization to a guest operating system in some instances.

Extensions and Alternatives

In the foregoing specification, the example implementations of thepresent invention have been described regarding numerous specificdetails. However, the details may vary from implementation toimplementation per the requirements of the implement at hand. Theexample implementations are, accordingly, to be regarded in anillustrative rather than a restrictive sense.

The invention claimed is:
 1. A system, comprising: one or moreprocessors; storage media; and one or more programs stored in thestorage media and configured for execution by the one or moreprocessors, the one or more programs comprising instructions configuredfor: obtaining compressed image data that is a coded representation of adigital image; decoding the compressed image data to obtain at least oneblock of quantized discrete cosine transform (DCT) coefficientscorresponding to a sample block of the digital image, the block ofquantized DCT coefficients comprising a DC coefficient and a pluralityof non-zero AC coefficients; determining probability estimates forbinary symbols of binarized representations of the plurality of non-zeroAC coefficients based, at least in part, on classifying each non-zero ACcoefficient of the plurality of non-zero AC coefficients as being partof at most one of: (a) a top-edge row of AC coefficients of the block ofquantized DCT coefficients, (b) a left-edge column of AC coefficients ofthe block of quantized DCT coefficients, or (c) a sub-block of ACcoefficients of the block of quantized DCT coefficients; wherein aparticular non-zero AC coefficient of the plurality of non-zero ACcoefficients is classified as being part of (c) the sub-block of ACcoefficients; wherein determining probability estimates for binarysymbols of a binarized representation of the particular non-zero ACcoefficient is based on: an AC coefficient corresponding in position tothe particular non-zero AC coefficient in an above quantized DCT blockof coefficients, an AC coefficient corresponding in position to theparticular non-zero AC coefficient in a left quantized DCT block ofcoefficients, and an AC coefficient corresponding in position to theparticular non-zero AC coefficient in an above-left quantized DCT blockof coefficients; arithmetic coding the binary symbols based, at least inpart, on the probability estimates; and based, at least in part, on thearithmetic coding, storing further compressed image data that is a codedrepresentation of the digital image, the further compressed image databeing lossless with respect to the compressed image data, the furthercompressed image data requiring fewer bytes to store in storage mediathan required by the compressed image data.
 2. The system of claim 1,wherein the determining the probability estimates for the binary symbolsof the binarized representation of the particular non-zero ACcoefficient is further based on: the logarithm of the absolute value ofthe AC coefficient corresponding in position to the particular non-zeroAC coefficient in the above quantized DCT block of coefficients to thebase two; the logarithm of the absolute value of the AC coefficientcorresponding in position to the particular non-zero AC coefficient inthe left quantized DCT block of coefficients to the base two; and thelogarithm of the absolute value of the AC coefficient corresponding inposition to the particular non-zero AC coefficient in the above-leftquantized DCT block of coefficients to the base two.
 3. The system ofclaim 1, wherein the determining the probability estimates for thebinary symbols of the binarized representation of the particularnon-zero AC coefficient is further based on a weighted average of: theAC coefficient corresponding in position to the particular non-zero ACcoefficient in the above quantized DCT block of coefficients; the ACcoefficient corresponding in position to the particular non-zero ACcoefficient in the left quantized DCT block of coefficients; and the ACcoefficient corresponding in position to the particular non-zero ACcoefficient in the above-left quantized DCT block of coefficients. 4.The system of claim 3, wherein: a first numerical weight in the weightedaverage applied to the AC coefficient corresponding in position to theparticular non-zero AC coefficient in the above quantized DCT block ofcoefficients is thirteen; a second numerical weight in the weightedaverage applied to the AC coefficient corresponding in position to theparticular non-zero AC coefficient in the left quantized DCT block ofcoefficients is thirteen; and a third numerical weight in the weightedaverage applied to the AC coefficient corresponding in position to theparticular non-zero AC coefficient in the above-left quantized DCT blockof coefficients is six.
 5. The system of claim 1, wherein thedetermining the probability estimates for the binary symbols of thebinarized representation of the particular non-zero AC coefficient isfurther based on an index of the particular non-zero AC coefficientwithin the sub-block of AC coefficients.
 6. The system of claim 1,wherein the binarized representation of the particular non-zero ACcoefficient includes a coefficient exponent component, followed by azero bit, followed by a sign bit component, followed by a residualcomponent.
 7. The system of claim 1, wherein the determining theprobability estimates for the binary symbols of the binarizedrepresentation of the particular non-zero AC coefficient is furtherbased on the number of non-zero AC coefficients in the sub-block of ACcoefficients.
 8. One or more non-transitory computer-readable mediastoring one or more programs for execution by one or more processors,the one or more programs comprising instructions configured for:obtaining compressed image data that is a coded representation of adigital image; decoding the compressed image data to obtain at least oneblock of quantized discrete cosine transform (DCT) coefficientscorresponding to a sample block of the digital image, the block ofquantized DCT coefficients comprising a DC coefficient and a pluralityof non-zero AC coefficients; determining probability estimates forbinary symbols of binarized representations of the plurality of non-zeroAC coefficients based, at least in part, on classifying each non-zero ACcoefficient of the plurality of non-zero AC coefficients as being partof at most one of: (a) a top-edge row of AC coefficients of the block ofquantized DCT coefficients, (b) a left-edge column of AC coefficients ofthe block of quantized DCT coefficients, or (c) a sub-block of ACcoefficients of the block of quantized DCT coefficients; wherein aparticular non-zero AC coefficient of the plurality of non-zero ACcoefficients is classified as being part of (c) the sub-block of ACcoefficients; wherein determining probability estimates for binarysymbols of a binarized representation of the particular non-zero ACcoefficient is based on: an AC coefficient corresponding in position tothe particular non-zero AC coefficient in an above quantized DCT blockof coefficients, an AC coefficient corresponding in position to theparticular non-zero AC coefficient in a left quantized DCT block ofcoefficients, and an AC coefficient corresponding in position to theparticular non-zero AC coefficient in an above-left quantized DCT blockof coefficients; arithmetic coding the binary symbols based, at least inpart, on the probability estimates; and based, at least in part, on thearithmetic coding, storing further compressed image data that is a codedrepresentation of the digital image, the further compressed image databeing lossless with respect to the compressed image data, the furthercompressed image data requiring fewer bytes to store in storage mediathan required by the compressed image data.
 9. The one or morenon-transitory computer-readable media of claim 8, wherein thedetermining the probability estimates for the binary symbols of thebinarized representation of the particular non-zero AC coefficient isfurther based on: the logarithm of the absolute value of the ACcoefficient corresponding in position to the particular non-zero ACcoefficient in the above quantized DCT block of coefficients to the basetwo; the logarithm of the absolute value of the AC coefficientcorresponding in position to the particular non-zero AC coefficient inthe left quantized DCT block of coefficients to the base two; and thelogarithm of the absolute value of the AC coefficient corresponding inposition to the particular non-zero AC coefficient in the above-leftquantized DCT block of coefficients to the base two.
 10. The one or morenon-transitory computer-readable media of claim 8, wherein thedetermining the probability estimates for the binary symbols of thebinarized representation of the particular non-zero AC coefficient isfurther based on a weighted average of: the AC coefficient correspondingin position to the particular non-zero AC coefficient in the abovequantized DCT block of coefficients; the AC coefficient corresponding inposition to the particular non-zero AC coefficient in the left quantizedDCT block of coefficients; and the AC coefficient corresponding inposition to the particular non-zero AC coefficient in the above-leftquantized DCT block of coefficients.
 11. The one or more non-transitorycomputer-readable media of claim 10, wherein: a first numerical weightin the weighted average applied to the AC coefficient corresponding inposition to the particular non-zero AC coefficient in the abovequantized DCT block of coefficients is thirteen; a second numericalweight in the weighted average applied to the AC coefficientcorresponding in position to the particular non-zero AC coefficient inthe left quantized DCT block of coefficients is thirteen; and a thirdnumerical weight in the weighted average applied to the AC coefficientcorresponding in position to the particular non-zero AC coefficient inthe above-left quantized DCT block of coefficients is six.
 12. The oneor more non-transitory computer-readable media of claim 8, wherein thedetermining the probability estimates for the binary symbols of thebinarized representation of the particular non-zero AC coefficient isfurther based on an index of the particular non-zero AC coefficientwithin the sub-block of AC coefficients.
 13. The one or morenon-transitory computer-readable media of claim 8, wherein the binarizedrepresentation of the particular non-zero AC coefficient includes acoefficient exponent component, followed by a zero bit, followed by asign bit component, followed by a residual component.
 14. The one ormore non-transitory computer-readable media of claim 8, wherein thedetermining the probability estimates for the binary symbols of thebinarized representation of the particular non-zero AC coefficient isfurther based on the number of non-zero AC coefficients in the sub-blockof AC coefficients.
 15. A method, comprising: obtaining compressed imagedata that is a coded representation of a digital image; decoding thecompressed image data to obtain at least one block of quantized discretecosine transform (DCT) coefficients corresponding to a sample block ofthe digital image, the block of quantized DCT coefficients comprising aDC coefficient and a plurality of non-zero AC coefficients; determiningprobability estimates for binary symbols of binarized representations ofthe plurality of non-zero AC coefficients based, at least in part, onclassifying each non-zero AC coefficient of the plurality of non-zero ACcoefficients as being part of at most one of: (a) a top-edge row of ACcoefficients of the block of quantized DCT coefficients, (b) a left-edgecolumn of AC coefficients of the block of quantized DCT coefficients, or(c) a sub-block of AC coefficients of the block of quantized DCTcoefficients; wherein a particular non-zero AC coefficient of theplurality of non-zero AC coefficients is classified as being part of (c)the sub-block of AC coefficients; wherein determining probabilityestimates for binary symbols of a binarized representation of theparticular non-zero AC coefficient is based on: an AC coefficientcorresponding in position to the particular non-zero AC coefficient inan above quantized DCT block of coefficients, an AC coefficientcorresponding in position to the particular non-zero AC coefficient in aleft quantized DCT block of coefficients, and an AC coefficientcorresponding in position to the particular non-zero AC coefficient inan above-left quantized DCT block of coefficients; arithmetic coding thebinary symbols based, at least in part, on the probability estimates;based, at least in part, on the arithmetic coding, storing furthercompressed image data that is a coded representation of the digitalimage, the further compressed image data being lossless with respect tothe compressed image data, the further compressed image data requiringfewer bytes to store in storage media than required by the compressedimage data; and wherein the method is performed by a computing systemcomprising one or more processors and storage media storing one or moreprograms, the one or more programs having instructions configured toperform the method.
 16. The method of claim 15, wherein the determiningthe probability estimates for the binary symbols of the binarizedrepresentation of the particular non-zero AC coefficient is furtherbased on: the logarithm of the absolute value of the AC coefficientcorresponding in position to the particular non-zero AC coefficient inthe above quantized DCT block of coefficients to the base two; thelogarithm of the absolute value of the AC coefficient corresponding inposition to the particular non-zero AC coefficient in the left quantizedDCT block of coefficients to the base two; and the logarithm of theabsolute value of the AC coefficient corresponding in position to theparticular non-zero AC coefficient in the above-left quantized DCT blockof coefficients to the base two.
 17. The method of claim 15, wherein thedetermining the probability estimates for the binary symbols of thebinarized representation of the particular non-zero AC coefficient isfurther based on a weighted average of: the AC coefficient correspondingin position to the particular non-zero AC coefficient in the abovequantized DCT block of coefficients; the AC coefficient corresponding inposition to the particular non-zero AC coefficient in the left quantizedDCT block of coefficients; and the AC coefficient corresponding inposition to the particular non-zero AC coefficient in the above-leftquantized DCT block of coefficients.
 18. The method of claim 17,wherein: a first numerical weight in the weighted average applied to theAC coefficient corresponding in position to the particular non-zero ACcoefficient in the above quantized DCT block of coefficients isthirteen; a second numerical weight in the weighted average applied tothe AC coefficient corresponding in position to the particular non-zeroAC coefficient in the left quantized DCT block of coefficients isthirteen; and a third numerical weight in the weighted average appliedto the AC coefficient corresponding in position to the particularnon-zero AC coefficient in the above-left quantized DCT block ofcoefficients is six.
 19. The method of claim 15, wherein the determiningthe probability estimates for the binary symbols of the binarizedrepresentation of the particular non-zero AC coefficient is furtherbased on an index of the particular non-zero AC coefficient within thesub-block of AC coefficients.
 20. The method of claim 15, wherein thebinarized representation of the particular non-zero AC coefficientincludes a coefficient exponent component, followed by a zero bit,followed by a sign bit component, followed by a residual component. 21.The method of claim 15, wherein the determining the probabilityestimates for the binary symbols of the binarized representation of theparticular non-zero AC coefficient is further based on the number ofnon-zero AC coefficients in the sub-block of AC coefficients.